// TutorialWrappingCLR.h

#pragma once

using namespace System;

namespace TutorialWrappingCLR {

	public ref class CTutorialWrappingCLR
	{
		HMODULE m_hRenderer;

	public:
		CTutorialWrappingCLR()
		{
		}

		~CTutorialWrappingCLR()
		{
			FreeLibrary(m_hRenderer);
		}

		bool LoadDLL()
		{
			m_hRenderer = LoadLibrary("4DyuchiGXRenderer.dll");
			if( !m_hRenderer )
			{
				return false;
			}

			pFunc = (CREATE_INSTANCE_FUNC)GetProcAddress(m_hRenderer,"DllCreateInstance");
			HRESULT hr = pFunc((void**)&m_pTileSetRenderer);

			if (hr != S_OK)
			{
				ASSERT("Fail to Create 4DyuchiGXRenderer");
				return;
			}

			return 0;
		}
	};
}
